import java.io.*;
import java.util.*;
import java.lang.*;
class Read{
    StringTokenizer st = new StringTokenizer("");
    BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
    String next() throws IOException{
        while(!st.hasMoreTokens()){
            st = new StringTokenizer(bf.readLine());
        }
        return (String)st.nextToken();
    }
    String nextLine() throws IOException{
        return bf.readLine();
    }
    int nextInt() throws IOException{
        return Integer.parseInt(next());
    }
    long nextLong() throws IOException{
        return Long.parseLong(next());
    }
    double nextDouble() throws IOException{
        return Double.parseDouble(next());
    }
}
public class Main {
    public static void main(String[] args) throws IOException{
        //读入数据
        Read in = new Read();
        int n = in.nextInt();
        //w数组不能开成int类型的，否则会发生隐式的类型转换（int->long），出现错误
        long[] w = new long[2*n];
        for(int i = 0; i < 2*n; i++){
            w[i] = in.nextInt();
        }
        //数组排序
        Arrays.sort(w);
        long sum = 0L;
        int len = w.length/2;
        for(int i = 0; i < len; i++){
            sum += w[i]*w[w.length-i-1];
        }
        System.out.println(sum);
    }
}
